package ext.acae2.change.mvc;

import java.util.ArrayList;
import java.util.List;

import wt.util.WTException;

import com.ptc.jca.mvc.components.JcaComponentParams;
import com.ptc.mvc.components.AbstractComponentBuilder;
import com.ptc.mvc.components.ColumnConfig;
import com.ptc.mvc.components.ComponentBuilder;
import com.ptc.mvc.components.ComponentConfig;
import com.ptc.mvc.components.ComponentConfigFactory;
import com.ptc.mvc.components.ComponentParams;
import com.ptc.mvc.components.TableConfig;
import com.ptc.netmarkets.util.beans.NmCommandBean;

/**
 * @desription TODO
 * @author cnie
 * @date 2013-5-16 下午8:37:03
 */
@ComponentBuilder("acae2.change.mvc.DepartmentRecordBuilder")
public class DepartmentRecordBuilder extends AbstractComponentBuilder {

	@Override
	public Object buildComponentData(ComponentConfig config, ComponentParams params)
			throws Exception {
		NmCommandBean cb = ((JcaComponentParams)params).getHelperBean().getNmCommandBean();
		List<ObjectDetailDataBean> objDetailBeans = new ArrayList<ObjectDetailDataBean>();
		return objDetailBeans;
	}

	@Override
	public ComponentConfig buildComponentConfig(ComponentParams arg0)
			throws WTException {
		ComponentConfigFactory factory = getComponentConfigFactory();
		TableConfig tableConfig = factory.newTableConfig();
		tableConfig.setLabel("数据发放条目");
		ColumnConfig columnConfig1 = factory.newColumnConfig("packNum", false);
		columnConfig1.setLabel("单号");
		//columnConfig1.setDataUtilityId("DataSendRecordUtility");
		tableConfig.addComponent(columnConfig1);

		ColumnConfig columnConfig2 = factory.newColumnConfig("number", false);
		columnConfig2.setLabel("编号");
		//columnConfig2.setDataUtilityId("DataSendRecordUtility");
		tableConfig.addComponent(columnConfig2);

		ColumnConfig columnConfig3 = factory.newColumnConfig("name", false);
		columnConfig3.setLabel("名称");
		tableConfig.addComponent(columnConfig3);

		ColumnConfig columnConfig4 = factory.newColumnConfig("objVersion",
				false);
		
		columnConfig4.setLabel("版本");
		tableConfig.addComponent(columnConfig4);

		ColumnConfig columnConfig5 = factory.newColumnConfig("sendDate", false);
		columnConfig5.setLabel("发放时间");
		tableConfig.addComponent(columnConfig5);

		ColumnConfig columnConfig6 = factory.newColumnConfig("sendType", false);
		columnConfig6.setLabel("发放类型");
		tableConfig.addComponent(columnConfig6);

		return tableConfig;
	}

}
